Tryit Editor v2.3

Edit This Code:
<!DOCTYPE html> <html> <body> <object id="myObject" width="250" height="200" data="helloworld.swf" name="obj1"></object> <p>Click the button to change the name of the object.</p> <button onclick="myFunction()">Try it</button> <p id="demo"></p> <script> function myFunction() { document.getElementById("myObject").name = "newObjName"; document.getElementById("demo").innerHTML = "The name of the object was changed from 'obj1' to 'newObjName'"; } </script> </body> <!-- Mirrored from www.w3schools.com/jsref/tryit.asp?filename=tryjsref_object_name2 by HTTrack Website Copier/3.x [XR&CO'2014], Fri, 23 Jan 2015 08:34:35 GMT --> </html>
Result:
Try it Yourself - © w3schools.com